package com.sino.struts2;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;
import com.sino.business.IQtzkService;
import com.sino.model.QtzkModel;

public class QtzkAction extends ActionSupport{
	private IQtzkService qtzkService = null;
	private QtzkModel qtzkModel = null;
	private String zlid;
	public String getZlid() {
		return zlid;
	}
	public void setZlid(String zlid) {
		this.zlid = zlid;
	}
	//---------------显示其他状况页面
	public String viewQtzk(){
		return this.SUCCESS;
	}
	//----------保存其他状况信息
	public String saveQtzk(){
		HttpSession session = ServletActionContext.getRequest().getSession();
		String zlId = (String)session.getAttribute("zlid");
		qtzkModel.setZlid(zlId);
		this.getQtzkService().saveQtzk(qtzkModel);
		return this.SUCCESS;
	}
	//----------更新其他状况信息
	public String updateQtzk(){
		HttpSession session = ServletActionContext.getRequest().getSession();
		String zlId = (String)session.getAttribute("zlid2");
		qtzkModel.setZlid(zlId);
		this.getQtzkService().saveQtzk(qtzkModel);
		return this.SUCCESS;
	}
	//---------查找其他状况信息
	public String findQtzk(){
		HttpSession session = ServletActionContext.getRequest().getSession();
		String zlId = (String)session.getAttribute("zlid");
		this.setQtzkModel(this.getQtzkService().findQtzk(zlId));
		return this.SUCCESS;
	}
	public String findQtzkToPrint(){
		
		this.setQtzkModel(this.getQtzkService().findQtzk(zlid));
		return this.SUCCESS;
	}
	//---------查找其他状况信息---用于更新
	public String findUpdateQtzk(){
		HttpSession session = ServletActionContext.getRequest().getSession();
		String zlId = (String)session.getAttribute("zlid2");
		this.setQtzkModel(this.getQtzkService().findQtzk(zlId));
		return this.SUCCESS;
	}
	//--------------------------------接口
	public QtzkModel getQtzkModel() {
		return qtzkModel;
	}

	public void setQtzkModel(QtzkModel qtzkModel) {
		this.qtzkModel = qtzkModel;
	}

	public IQtzkService getQtzkService() {
		return qtzkService;
	}

	public void setQtzkService(IQtzkService qtzkService) {
		this.qtzkService = qtzkService;
	}
	
}
